package br.com.audasi.audasiservices.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import br.com.audasi.audasiservices.dao.OrdemServicoRepository;

@Controller
public class HomeController {

	@Autowired
	private OrdemServicoRepository repository;

	@RequestMapping("/")
	public ModelAndView index(Map<String, Object> model) {
		
		ModelAndView resultado = new ModelAndView("index");
		resultado.addObject("ordemServico", repository.findAll());
		return resultado;
	}

}
